<template>
  <div>
    <ul v-for="v in liebiao" :key="v.id" @click="fun(v.id)">
      <li>
        <img :src="v.img" />
      </li>
      <li>
        <h6>{{ v.name }}</h6>
        <p>{{ v.textea }}</p>
        <span class="zhijiang">{{ v.zhijiang }}</span>
        <h5 class="h5">
          <span>￥{{ v.money }}</span
          ><del>{{ v.del }}</del>
        </h5>
      </li>
      <li>
        <div class="zuiyou">
          <b></b><span>{{v.zhanbi}}</span>
          <p>立即抢购</p>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
import axios from "axios";
export default {
  name: "liebiao",
  props: {
    type: String,
  },
  data() {
    return {
      typeObj: {
        hot: "热卖",
        biqiang:"",
      },
      liebiao: [],
    };
  },
  created() {
    axios
      .get("/liebiao1", {
        params: {
          type: this.type,
        },
      })
      .then((res) => {
        this.liebiao = res.data;
      })
      .catch((err) => {
        console.log("服务器出错了", err);
        alert("服务器出错了");
      });
  },
  methods: {
    fun(id) {
      this.$router.push({ path: "/xq", query: { id: id } });
    },
  },
};
</script>

<style scoped>
img {
  width: 1.08rem;
  height: 1.08rem;
}
ul {
  display: flex;
  background-color: rgb(255, 255, 255);
  border-radius: 0.1rem;
  margin-top: 0.15rem;
  height: 1.26rem;
}
ul li {
  margin: 0.06rem;
}
ul li:nth-child(2) h6 {
  font-size: 0.16rem;
}
ul li:nth-child(2) {
  width: 1.6rem;
}
ul li:nth-child(2) p {
  border-color: rgb(243, 8, 11);
  color: rgb(248, 36, 0);
  font-size: 12px;
  font-weight: 400;
  height: 20px;
  letter-spacing: -0.24px;
  line-height: 23px;
  max-width: 216px;
}
.zhijiang {
  margin-top: 0.22rem;
  display: inline-block;
  border: 0.01rem red solid;
  color: red;
}
.h5 {
  font-weight: normal;
}
.h5 span {
  font-size: 0.18rem;
  color: red;
}
.zuiyou {
  width: 0.86rem;
  height: 0.42rem;
  border-color: rgb(255, 51, 18);
  border-radius: 0.06rem;
  background-color: rgb(255, 51, 18);
  margin-top: 0.7rem;
  color: white;
  text-align: center;
}
.zuiyou b {
  width: 0.5rem;
  height: 0.05rem;
  display: inline-block;
  background-color: #ffa292;
  border-radius: 0.1rem;
}
.zuiyou span {
  font-size: 0.1rem;
  display: inline-block;
}
</style>